import React from 'react';

import {
  View,
  TouchableOpacity,
  Text,
  Picker,

Image,
} from 'react-native';

import {SearchBar} from 'react-native-elements';
import Platform from 'Platform';

import Config from '../../config';
import SizeUtils from '../../common/SizeUtils';
import CommonStyles from '../../common/CommonStyles';
import BaseItem from '../common/BaseItem';
import CommonSearchListPage from '../common/CommonSearchListPage';
import QuanziItemView from './QuanziItemView';
import TImage from '../../components/TImage';
import QuanziRequestSearchListAction from '../../actions/quanzi/QuanziRequestSearchListAction';
export default class QZ_SearchPage extends CommonSearchListPage {
  constructor(props) {
    super(props);
    
    this._dataKey = "board_id";
  }

  _renderTopView() {
    return (
      <View style={{flexDirection:"row",
         borderColor: '#eeeeee',
         height:SizeUtils.translateDesignHeightToCode(90),
         paddingLeft:SizeUtils.translateDesignWidthToCode(40),
         paddingRight:SizeUtils.translateDesignWidthToCode(40),
         borderBottomWidth: SizeUtils.translateDesignNumToCode(3)}}>
        {this._renderSearchBg()}
      </View>
    )
  }

  _getSearchBarContainerStyle() {
    return {width:SizeUtils.getWindowSize().width - SizeUtils.translateDesignWidthToCode(160),
      borderTopWidth:0,borderBottomWidth:0,
      height:SizeUtils.translateDesignHeightToCode(62),backgroundColor:"#00000000",};
  }

  _getListViewStyle() {
    return {
        width:SizeUtils.getWindowSize().width,
        height:(SizeUtils.getWindowSize().height - Config.paddingTop - SizeUtils.translateDesignHeightToCode(40 + 90)),
        backgroundColor:"#ffffff"};
  }

  _onPressItem(data) {
    this.gotoPage(Config.pages.quanzi_content, data);
  }

  _onRenderItem(data, index) {
    return (<QuanziItemView data={data} index={index} />)
  }

  _sendAction(page, listView) {
    new QuanziRequestSearchListAction().call(listView, {key:this.state.searchText, page:page,})
  }
}
